﻿using System.Diagnostics;
using System.ComponentModel;
using System;

namespace GraphViewerWpf.Graph
{
    [DebuggerDisplay("{Source.Id} -> {Target.Id}")]
    public class Edge : QuickGraph.Edge<Vertex>, INotifyPropertyChanged
    {
        private string id;

        public string Id
        {
            get { return id; }
            set
            {
                id = value;
                NotifyPropertyChanged("Id");
            }
        }

        public Edge(string id, Vertex source, Vertex target)
            : base(source, target)
        {
            Id = id;
        }

        public event PropertyChangedEventHandler PropertyChanged;

        private void NotifyPropertyChanged(string info)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(info));
            }
        }
    }
}